<!DOCTYPE html>
<html lang="en" dir="ltr" class="scroll-smooth" data-default-appearance="dark"
  data-auto-appearance="true"><head>
  <meta charset="utf-8" />
  
  <meta http-equiv="content-language" content="en" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  
  <title>RabbitMq &middot; 春江花朝秋月夜</title>
  <meta name="title" content="RabbitMq &middot; 春江花朝秋月夜" />
  
  <meta name="description" content="A powerful, lightweight theme for Hugo built with Tailwind CSS." />
  <meta name="keywords" content="消息队列, " />
  
  
  <link rel="canonical" href="/entire-note/mq/" />
  
  
  
  
  
  
  
  
  
  
  <link type="text/css" rel="stylesheet" href="/css/main.bundle.min.4d4b1b35ed4fb37d198f5f4fa732e64404b535101cdef4401ac22e7c91380b82f3c8e5d51ae61f0149e6a95694c77e5a40943ca8480609a230c10f33c1fc11b4.css"
    integrity="sha512-TUsbNe1Ps30Zj19PpzLmRAS1NRAc3vRAGsIufJE4C4LzyOXVGuYfAUnmqVaUx35aQJQ8qEgGCaIwwQ8zwfwRtA==" />
  
  
  <script type="text/javascript" src="/js/appearance.min.516a16745bea5a9bd011138d254cc0fd3973cd55ce6e15f3dec763e7c7c2c7448f8fe7b54cca811cb821b0c7e12cd161caace1dd794ac3d34d40937cbcc9ee12.js"
    integrity="sha512-UWoWdFvqWpvQERONJUzA/TlzzVXObhXz3sdj58fCx0SPj&#43;e1TMqBHLghsMfhLNFhyqzh3XlKw9NNQJN8vMnuEg=="></script>
  
  
  
  
  
  
  
  
  
  
  
  
  <script defer type="text/javascript" id="script-bundle" src="/js/main.bundle.min.f0ecd26160d4c29256b0f2b96ebe0be0f1c839488a839c5190ed198437fe5a1bd0ede0c86f0108806fd0ea43c987923aa4a63fe7ed09813eb9e8ad531ca58ae4.js"
    integrity="sha512-8OzSYWDUwpJWsPK5br4L4PHIOUiKg5xRkO0ZhDf&#43;WhvQ7eDIbwEIgG/Q6kPJh5I6pKY/5&#43;0JgT656K1THKWK5A==" data-copy="" data-copied=""></script>
  
  <script src="/js/zoom.min.js"></script>
  
  
  <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
  <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
  <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
  <link rel="manifest" href="/site.webmanifest" />
  
  
  
  
  
  
  
  <meta property="og:title" content="RabbitMq" />
<meta property="og:description" content="认识RabbitMQ # 环境：ubangtu # 访问协议： amqp
了解安装（反正也记不住）：
sudo apt install erlang sudo apt install rabbitmq-server sudo rabbitmqctl status sudo rabbitmq-plugins enable rabbitmq_management sudo rabbitmqctl add_user 用户名 密码 sudo rabbitmqctl set_user_tags admin administrator 设计架构图：" />
<meta property="og:type" content="article" />
<meta property="og:url" content="/entire-note/mq/" /><meta property="og:image" content="/entire-note/mq/featured.png"/><meta property="article:section" content="entire-note" />
<meta property="article:published_time" content="2023-11-07T20:52:20+08:00" />
<meta property="article:modified_time" content="2023-11-07T20:52:20+08:00" />

  <meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="/entire-note/mq/featured.png"/>
<meta name="twitter:title" content="RabbitMq"/>
<meta name="twitter:description" content="认识RabbitMQ # 环境：ubangtu # 访问协议： amqp
了解安装（反正也记不住）：
sudo apt install erlang sudo apt install rabbitmq-server sudo rabbitmqctl status sudo rabbitmq-plugins enable rabbitmq_management sudo rabbitmqctl add_user 用户名 密码 sudo rabbitmqctl set_user_tags admin administrator 设计架构图："/>

  
  <script type="application/ld+json">
  [{
    "@context": "https://schema.org",
    "@type": "Article",
    "articleSection": "Entire-notes",
    "name": "RabbitMq",
    "headline": "RabbitMq",
    
    "abstract": "认识RabbitMQ # 环境：ubangtu # 访问协议： amqp\n了解安装（反正也记不住）：\nsudo apt install erlang sudo apt install rabbitmq-server sudo rabbitmqctl status sudo rabbitmq-plugins enable rabbitmq_management sudo rabbitmqctl add_user 用户名 密码 sudo rabbitmqctl set_user_tags admin administrator 设计架构图：",
    "inLanguage": "en",
    "url" : "\/entire-note\/mq\/",
    "author" : {
      "@type": "Person",
      "name": "春江花朝秋月夜"
    },
    "copyrightYear": "2023",
    "dateCreated": "2023-11-07T20:52:20\u002b08:00",
    "datePublished": "2023-11-07T20:52:20\u002b08:00",
    
    "dateModified": "2023-11-07T20:52:20\u002b08:00",
    
    "keywords": ["消息队列"],
    
    "mainEntityOfPage": "true",
    "wordCount": "361"
  }]
  </script>


  
  
  <meta name="author" content="春江花朝秋月夜" />
  
  
  
  <link href="https://space.bilibili.com/159283119?spm_id_from=333.1007.0.0" rel="me" />
  
  
  <link href="https://github.com/ToDreamr" rel="me" />
  
  
  
  

<script src="/lib/jquery/jquery.slim.min.js" integrity=""></script>


















  
  

<script async src="https://www.googletagmanager.com/gtag/js?id=G-PEDMYR1V0K"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-PEDMYR1V0K');
</script>

  
  
  <meta name="theme-color"/>
  
  
</head>
<body
  class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32">
  <div id="the-top" class="absolute flex self-center">
    <a class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 focus:translate-y-0 dark:bg-neutral-600"
      href="#main-content"><span
        class="font-bold text-primary-600 ltr:pr-2 rtl:pl-2 dark:text-primary-400">&darr;</span>Skip to main content</a>
  </div>
  
  
  <div class="min-h-[148px]"></div>
<div class="fixed inset-x-0 pl-[24px] pr-[24px]" style="z-index:100">
  <div id="menu-blur" class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl shadow-2xl"></div>
  <div class="relative max-w-[64rem] ml-auto mr-auto">
    <div style="padding-left:0;padding-right:0;padding-top:2px;padding-bottom:3px"
    class="main-menu flex items-center justify-between px-4 py-6 sm:px-6 md:justify-start space-x-3">
    
    
    
    <div>
        <a href="/" class="flex">
            <span class="sr-only">春江花朝秋月夜</span>

            <img src="/img/author.png" width="16" height="16"
                class="logo max-h-[5rem] max-w-[5rem] object-scale-down object-left nozoom" alt="春江花朝秋月夜" />

        </a>
    </div>
    
    <div class="flex flex-1 items-center justify-between">
        <nav class="flex space-x-3">

            <a href="/" class="text-base font-medium text-gray-500 hover:text-gray-900">春江花朝秋月夜</a>


        </nav>
        <nav class="hidden md:flex items-center space-x-5 md:ml-12 h-12">

            
            
            
  <a href="/"  class="flex items-center">
    
    <p class="text-base font-medium text-gray-500 hover:text-gray-900" title="">
        首页
    </p>
</a>


            
            
  <a href="/tags/%E7%AC%94%E8%AE%B0/"  class="flex items-center">
    
    <p class="text-base font-medium text-gray-500 hover:text-gray-900" title="笔记">
        笔记
    </p>
</a>


            
            
  <a href="/tasks/"  class="flex items-center">
    
    <p class="text-base font-medium text-gray-500 hover:text-gray-900" title="学习计划">
        事项
    </p>
</a>


            
            
  <a href="/all/"  class="flex items-center">
    
    <p class="text-base font-medium text-gray-500 hover:text-gray-900" title="全部">
        全部
    </p>
</a>


            
            
  <a href="/tags/"  class="flex items-center">
    
    <p class="text-base font-medium text-gray-500 hover:text-gray-900" title="Tags">
        系列文章
    </p>
</a>


            
            
  <a href="/friend/"  class="flex items-center">
    
    <p class="text-base font-medium text-gray-500 hover:text-gray-900" title="Hello">
        友链
    </p>
</a>


            
            

            


            
            <button id="search-button" aria-label="Search" class="text-base hover:text-primary-600 dark:hover:text-primary-400 h-12"
                title="">
                

  <span class="relative block icon">
    <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="search" class="svg-inline--fa fa-search fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"/></svg>

  </span>


            </button>
            


            
            
            <div
                class="ltr:mr-14 rtl:ml-14 cursor-pointer text-sm text-neutral-700 hover:text-primary-600 dark:text-neutral dark:hover:text-primary-400">
                <button id="appearance-switcher" aria-label="Dark mode switcher" type="button">
                    <div class="flex items-center justify-center h-12 dark:hidden">
                        

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M32 256c0-123.8 100.3-224 223.8-224c11.36 0 29.7 1.668 40.9 3.746c9.616 1.777 11.75 14.63 3.279 19.44C245 86.5 211.2 144.6 211.2 207.8c0 109.7 99.71 193 208.3 172.3c9.561-1.805 16.28 9.324 10.11 16.95C387.9 448.6 324.8 480 255.8 480C132.1 480 32 379.6 32 256z"/></svg>

  </span>


                    </div>
                    <div class="items-center justify-center hidden h-12 dark:flex">
                        

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 159.1c-53.02 0-95.1 42.98-95.1 95.1S202.1 351.1 256 351.1s95.1-42.98 95.1-95.1S309 159.1 256 159.1zM509.3 347L446.1 255.1l63.15-91.01c6.332-9.125 1.104-21.74-9.826-23.72l-109-19.7l-19.7-109c-1.975-10.93-14.59-16.16-23.72-9.824L256 65.89L164.1 2.736c-9.125-6.332-21.74-1.107-23.72 9.824L121.6 121.6L12.56 141.3C1.633 143.2-3.596 155.9 2.736 164.1L65.89 256l-63.15 91.01c-6.332 9.125-1.105 21.74 9.824 23.72l109 19.7l19.7 109c1.975 10.93 14.59 16.16 23.72 9.824L256 446.1l91.01 63.15c9.127 6.334 21.75 1.107 23.72-9.822l19.7-109l109-19.7C510.4 368.8 515.6 356.1 509.3 347zM256 383.1c-70.69 0-127.1-57.31-127.1-127.1c0-70.69 57.31-127.1 127.1-127.1s127.1 57.3 127.1 127.1C383.1 326.7 326.7 383.1 256 383.1z"/></svg>

  </span>


                    </div>
                </button>
            </div>
            

        </nav>
        <div class="flex md:hidden items-center space-x-5 md:ml-12">

            <span></span>

            


            
            <button id="search-button-mobile" aria-label="Search" class="text-base hover:text-primary-600 dark:hover:text-primary-400"
                title="">
                

  <span class="relative block icon">
    <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="search" class="svg-inline--fa fa-search fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"/></svg>

  </span>


            </button>
            

            
            
            <button id="appearance-switcher-mobile" aria-label="Dark mode switcher" type="button" style="margin-right:5px">
                <div class="flex items-center justify-center h-12 dark:hidden">
                    

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M32 256c0-123.8 100.3-224 223.8-224c11.36 0 29.7 1.668 40.9 3.746c9.616 1.777 11.75 14.63 3.279 19.44C245 86.5 211.2 144.6 211.2 207.8c0 109.7 99.71 193 208.3 172.3c9.561-1.805 16.28 9.324 10.11 16.95C387.9 448.6 324.8 480 255.8 480C132.1 480 32 379.6 32 256z"/></svg>

  </span>


                </div>
                <div class="items-center justify-center hidden h-12 dark:flex">
                    

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 159.1c-53.02 0-95.1 42.98-95.1 95.1S202.1 351.1 256 351.1s95.1-42.98 95.1-95.1S309 159.1 256 159.1zM509.3 347L446.1 255.1l63.15-91.01c6.332-9.125 1.104-21.74-9.826-23.72l-109-19.7l-19.7-109c-1.975-10.93-14.59-16.16-23.72-9.824L256 65.89L164.1 2.736c-9.125-6.332-21.74-1.107-23.72 9.824L121.6 121.6L12.56 141.3C1.633 143.2-3.596 155.9 2.736 164.1L65.89 256l-63.15 91.01c-6.332 9.125-1.105 21.74 9.824 23.72l109 19.7l19.7 109c1.975 10.93 14.59 16.16 23.72 9.824L256 446.1l91.01 63.15c9.127 6.334 21.75 1.107 23.72-9.822l19.7-109l109-19.7C510.4 368.8 515.6 356.1 509.3 347zM256 383.1c-70.69 0-127.1-57.31-127.1-127.1c0-70.69 57.31-127.1 127.1-127.1s127.1 57.3 127.1 127.1C383.1 326.7 326.7 383.1 256 383.1z"/></svg>

  </span>


                </div>
            </button>
            

        </div>
    </div>
    <div class="-my-2 -mr-2 md:hidden">

        <label id="menu-button" for="menu-controller" class="block">
            <input type="checkbox" id="menu-controller" class="hidden" />
            <div class="cursor-pointer hover:text-primary-600 dark:hover:text-primary-400">
                

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M0 96C0 78.33 14.33 64 32 64H416C433.7 64 448 78.33 448 96C448 113.7 433.7 128 416 128H32C14.33 128 0 113.7 0 96zM0 256C0 238.3 14.33 224 32 224H416C433.7 224 448 238.3 448 256C448 273.7 433.7 288 416 288H32C14.33 288 0 273.7 0 256zM416 448H32C14.33 448 0 433.7 0 416C0 398.3 14.33 384 32 384H416C433.7 384 448 398.3 448 416C448 433.7 433.7 448 416 448z"/></svg>

  </span>


            </div>
            <div id="menu-wrapper" style="padding-top:5px;"
                class="fixed inset-0 z-30 invisible w-screen h-screen m-0 overflow-auto transition-opacity opacity-0 cursor-default bg-neutral-100/50 backdrop-blur-sm dark:bg-neutral-900/50">
                <ul
                    class="flex space-y-2 mt-3 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl">

                    <li>
                        <span
                            class="cursor-pointer inline-block align-text-bottom hover:text-primary-600 dark:hover:text-primary-400">

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>

  </span>

</span>
                    </li>

                    
                    

                    
  <li class="mt-1">
    <a href="/"  class="flex items-center">
        
        <p class="text-bg font-bg text-gray-500 hover:text-gray-900" title="">
            首页
        </p>
    </a>
</li>



                    

                    
  <li class="mt-1">
    <a href="/tags/%E7%AC%94%E8%AE%B0/"  class="flex items-center">
        
        <p class="text-bg font-bg text-gray-500 hover:text-gray-900" title="笔记">
            笔记
        </p>
    </a>
</li>



                    

                    
  <li class="mt-1">
    <a href="/tasks/"  class="flex items-center">
        
        <p class="text-bg font-bg text-gray-500 hover:text-gray-900" title="学习计划">
            事项
        </p>
    </a>
</li>



                    

                    
  <li class="mt-1">
    <a href="/all/"  class="flex items-center">
        
        <p class="text-bg font-bg text-gray-500 hover:text-gray-900" title="全部">
            全部
        </p>
    </a>
</li>



                    

                    
  <li class="mt-1">
    <a href="/tags/"  class="flex items-center">
        
        <p class="text-bg font-bg text-gray-500 hover:text-gray-900" title="Tags">
            系列文章
        </p>
    </a>
</li>



                    

                    
  <li class="mt-1">
    <a href="/friend/"  class="flex items-center">
        
        <p class="text-bg font-bg text-gray-500 hover:text-gray-900" title="Hello">
            友链
        </p>
    </a>
</li>



                    
                    

                </ul>
                

            </div>
        </label>
    </div>
</div>




<script>
    (function () {
        var $mainmenu = $('.main-menu');
        var path = window.location.pathname;
        $mainmenu.find('a[href="' + path + '"]').each(function (i, e) {
            $(e).children('p').addClass('active');
        });
    })();
</script>


  </div>
</div>
<script>
  window.addEventListener('scroll', function (e) {
    var scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
    var background_blur = document.getElementById('menu-blur');
    background_blur.style.opacity = (scroll / 300);
  });
</script>

  
  <div class="relative flex flex-col grow">
    <main id="main-content" class="grow">
      


<article>
    
    
    
    
    
    


<div id="hero" class="h-[150px] md:h-[200px]"></div>


    
    <div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
    style="background-image:url(/entire-note/mq/featured_hudef721336a93359b32cb62f31dfdc2fa_336333_1200x0_resize_box_3.png);">
    


    <div class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal">
    </div>
    <div
        class="absolute inset-0 opacity-60 bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral-100 dark:to-neutral-800 mix-blend-normal">
    </div>
</div>

    
    

    <header id="single_header" class="mt-5 max-w-prose">
        
        <ol class="text-sm text-neutral-500 dark:text-neutral-400 print:hidden">
  
  
    
  
    
  
  <li class="inline hidden">
    <a
      class="hover:underline decoration-neutral-300 dark:underline-neutral-600"
      href="/"
      ></a
    ><span class="px-1 text-primary-500">/</span>
  </li>

  
  <li class="inline ">
    <a
      class="hover:underline decoration-neutral-300 dark:underline-neutral-600"
      href="/entire-note/"
      >Entire-notes</a
    ><span class="px-1 text-primary-500">/</span>
  </li>

  
  <li class="inline hidden">
    <a
      class="hover:underline decoration-neutral-300 dark:underline-neutral-600"
      href="/entire-note/mq/"
      >RabbitMq</a
    ><span class="px-1 text-primary-500">/</span>
  </li>

</ol>


        
        <h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral" style="font-family: 华文中宋,serif">
            RabbitMq
        </h1>
        <div class="mt-1 mb-6 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
            






































<div class="flex flex-row flex-wrap items-center">
  
  
  <span title="Reading time">2 mins</span><span class="px-2 text-primary-500">&middot;</span><span>
    
    <span id="views_entire-note\mq\index.md" title="views">0</span> 
    
    <span class="inline-block align-text-bottom">

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">
<path fill="currentColor" d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM432 256c0 79.5-64.5 144-144 144s-144-64.5-144-144s64.5-144 144-144s144 64.5 144 144zM288 192c0 35.3-28.7 64-64 64c-11.5 0-22.3-3-31.6-8.4c-.2 2.8-.4 5.5-.4 8.4c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-2.8 0-5.6 .1-8.4 .4c5.3 9.3 8.4 20.1 8.4 31.6z"/></svg>
  </span>

</span>
</span><span class="px-2 text-primary-500">&middot;</span><span>
    
    <span id="likes_entire-note\mq\index.md" title="likes">0</span> 
    
    <span class="inline-block align-text-bottom">

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path fill="currentColor" d="M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"/></svg>
  </span>

</span>
</span><span class="px-2 text-primary-500">&middot;</span><span>
    <button id="likes_button"
        class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400"
        onclick="process_article()">
        <span id="likes_button_heart" style="display:none" class="inline-block align-text-bottom">

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path fill="currentColor" d="M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"/></svg>
  </span>

 </span>
        <span id="likes_button_emtpty_heart" class="inline-block align-text-bottom">

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path fill="currentColor" d="M244 84L255.1 96L267.1 84.02C300.6 51.37 347 36.51 392.6 44.1C461.5 55.58 512 115.2 512 185.1V190.9C512 232.4 494.8 272.1 464.4 300.4L283.7 469.1C276.2 476.1 266.3 480 256 480C245.7 480 235.8 476.1 228.3 469.1L47.59 300.4C17.23 272.1 0 232.4 0 190.9V185.1C0 115.2 50.52 55.58 119.4 44.1C164.1 36.51 211.4 51.37 244 84C243.1 84 244 84.01 244 84L244 84zM255.1 163.9L210.1 117.1C188.4 96.28 157.6 86.4 127.3 91.44C81.55 99.07 48 138.7 48 185.1V190.9C48 219.1 59.71 246.1 80.34 265.3L256 429.3L431.7 265.3C452.3 246.1 464 219.1 464 190.9V185.1C464 138.7 430.4 99.07 384.7 91.44C354.4 86.4 323.6 96.28 301.9 117.1L255.1 163.9z"/></svg>
  </span>

</span>
        <span id="likes_button_text">&nbsp;Like</span>
    </button>
</span>
  

  
  
</div>


<div class="flex flex-row flex-wrap items-center">
  
  
  
  
  
  
  
  
  
  
  
</div>




<div class="flex flex-row flex-wrap items-center">
  
  
  
  
  
  
  
  
  
  
  
  
  <span style="margin-top:0.5rem" class="mr-2" onclick="window.open(&#34;/tags/%E6%B6%88%E6%81%AF%E9%98%9F%E5%88%97/&#34;,'_self');">
    <span class="flex">
  <span
    class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400"
  >
    消息队列
  </span>
</span>

  </span>
  
  
  
  
</div>



        </div>

        
        
        
        
        

        
        
        
<div class="flex">
  
  
  
  
  
  
  <img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96"
    alt="春江花朝秋月夜" src="/img/default_hud65e42c374bcd9580abb2944fca98866_909698_192x192_fill_box_center_3.png" />
  
  
  <div class="place-self-center">
    
    <div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
      Author
    </div>
    <div class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
      春江花朝秋月夜
    </div>
    
    
    <div class="text-sm text-neutral-700 dark:text-neutral-400">重湖叠𪩘清嘉。有三秋桂子，十里荷花。羌管弄晴，菱歌泛夜，嬉嬉钓叟莲娃。千骑拥高牙。乘醉听箫鼓，吟赏烟霞。异日图将好景，归去凤池夸。</div>
    
    <div class="text-2xl sm:text-lg">
  <div class="flex flex-wrap text-neutral-400 dark:text-neutral-500">
    
      
        <a
          class="px-1 hover:text-primary-700 dark:hover:text-primary-400"
          href="https://space.bilibili.com/159283119?spm_id_from=333.1007.0.0"
          target="_blank"
          aria-label="Bilibili"
          rel="me noopener noreferrer"
          ><span class="inline-block align-text-bottom">

  <span class="relative block icon">
    <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1699377062375" class="icon" viewBox="0 0 1129 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4167" xmlns:xlink="http://www.w3.org/1999/xlink" width="220.5078125" height="200"><path d="M234.909 9.656a80.468 80.468 0 0 1 68.398 0 167.374 167.374 0 0 1 41.843 30.578l160.937 140.82h115.07l160.936-140.82a168.983 168.983 0 0 1 41.843-30.578A80.468 80.468 0 0 1 930.96 76.445a80.468 80.468 0 0 1-17.703 53.914 449.818 449.818 0 0 1-35.406 32.187 232.553 232.553 0 0 1-22.531 18.508h100.585a170.593 170.593 0 0 1 118.289 53.109 171.397 171.397 0 0 1 53.914 118.288v462.693a325.897 325.897 0 0 1-4.024 70.007 178.64 178.64 0 0 1-80.468 112.656 173.007 173.007 0 0 1-92.539 25.75h-738.7a341.186 341.186 0 0 1-72.421-4.024A177.835 177.835 0 0 1 28.91 939.065a172.202 172.202 0 0 1-27.36-92.539V388.662a360.498 360.498 0 0 1 0-66.789A177.03 177.03 0 0 1 162.487 178.64h105.414c-16.899-12.07-31.383-26.555-46.672-39.43a80.468 80.468 0 0 1-25.75-65.984 80.468 80.468 0 0 1 39.43-63.57M216.4 321.873a80.468 80.468 0 0 0-63.57 57.937 108.632 108.632 0 0 0 0 30.578v380.615a80.468 80.468 0 0 0 55.523 80.469 106.218 106.218 0 0 0 34.601 5.632h654.208a80.468 80.468 0 0 0 76.444-47.476 112.656 112.656 0 0 0 8.047-53.109v-354.06a135.187 135.187 0 0 0 0-38.625 80.468 80.468 0 0 0-52.304-54.719 129.554 129.554 0 0 0-49.89-7.242H254.22a268.764 268.764 0 0 0-37.82 0z m0 0" fill="#20B0E3" p-id="4168"></path><path d="M348.369 447.404a80.468 80.468 0 0 1 55.523 18.507 80.468 80.468 0 0 1 28.164 59.547v80.468a80.468 80.468 0 0 1-16.094 51.5 80.468 80.468 0 0 1-131.968-9.656 104.609 104.609 0 0 1-10.46-54.719v-80.468a80.468 80.468 0 0 1 70.007-67.593z m416.02 0a80.468 80.468 0 0 1 86.102 75.64v80.468a94.148 94.148 0 0 1-12.07 53.11 80.468 80.468 0 0 1-132.773 0 95.757 95.757 0 0 1-12.875-57.133V519.02a80.468 80.468 0 0 1 70.007-70.812z m0 0" fill="#20B0E3" p-id="4169"></path></svg>
  </span>

</span></a
        >
      
    
      
        <a
          class="px-1 hover:text-primary-700 dark:hover:text-primary-400"
          href="https://github.com/ToDreamr"
          target="_blank"
          aria-label="Github"
          rel="me noopener noreferrer"
          ><span class="inline-block align-text-bottom">

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>

  </span>

</span></a
        >
      
    
  </div>

</div>
  </div>
</div>
        

        

        

        
        <div class="mb-5"></div>
        

    </header>

    <section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row" style="width: 100%">

        
        <div
            class="order-first sm:max-w-prose lg:ml-auto px-0 lg:order-last lg:max-w-xs ltr:lg:pl-8 rtl:lg:pr-8">
        <div class="toc ltr:pl-5 rtl:pr-5 print:hidden lg:sticky lg:top-[140px]">

         <details open class="mt-0 overflow-hidden rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 hidden lg:block">
  <summary
    class="block py-1 text-lg font-semibold cursor-pointer bg-neutral-100 text-neutral-800 ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 dark:bg-neutral-700 dark:text-neutral-100 lg:hidden">
    Table of Contents
  </summary>
  <div
    class="min-w-[220px] py-2 border-dotted border-neutral-300 ltr:-ml-5 ltr:border-l ltr:pl-5 rtl:-mr-5 rtl:border-r rtl:pr-5 dark:border-neutral-600">
    <nav id="TableOfContents">
  <ul>
    <li>
      <ul>
        <li><a href="#认识rabbitmq">认识RabbitMQ</a>
          <ul>
            <li><a href="#环境ubangtu">环境：ubangtu</a></li>
            <li><a href="#交换机">交换机</a></li>
            <li><a href="#创建队列">创建队列</a></li>
            <li><a href="#获取消息模式-ack-mode">获取消息模式 Ack Mode</a></li>
          </ul>
        </li>
        <li><a href="#rabbitmq整合springboot">RabbitMq整合SpringBoot</a>
          <ul>
            <li><a href="#创建队列-1">创建队列：</a></li>
            <li><a href="#发送消息">发送消息</a></li>
            <li><a href="#处理消息">处理消息</a></li>
          </ul>
        </li>
        <li><a href="#消息队列">消息队列</a>
          <ul>
            <li><a href="#死信队列">死信队列</a></li>
            <li><a href="#工作队列模式">工作队列模式</a></li>
            <li><a href="#发布订阅模式">发布订阅模式</a></li>
            <li><a href="#路由模式">路由模式</a></li>
            <li><a href="#主题模式-trace">主题模式 trace</a></li>
            <li><a href="#第四种交换机类型使用头部信息来实现路由消息到队列中">第四种交换机类型（使用头部信息来实现路由消息到队列中）</a></li>
            <li><a href="#搭建集群">搭建集群</a></li>
          </ul>
        </li>
        <li><a href="#springcloud消息组件">SpringCloud消息组件</a></li>
      </ul>
    </li>
  </ul>
</nav>
  </div>
</details>
<details class="mt-0 overflow-hidden rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 lg:hidden">
  <summary
    class="py-1 text-lg font-semibold cursor-pointer bg-neutral-100 text-neutral-800 ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 dark:bg-neutral-700 dark:text-neutral-100 lg:hidden">
    Table of Contents
  </summary>
  <div
    class="py-2 border-dotted border-neutral-300 ltr:-ml-5 ltr:border-l ltr:pl-5 rtl:-mr-5 rtl:border-r rtl:pr-5 dark:border-neutral-600">
    <nav id="TableOfContents">
  <ul>
    <li>
      <ul>
        <li><a href="#认识rabbitmq">认识RabbitMQ</a>
          <ul>
            <li><a href="#环境ubangtu">环境：ubangtu</a></li>
            <li><a href="#交换机">交换机</a></li>
            <li><a href="#创建队列">创建队列</a></li>
            <li><a href="#获取消息模式-ack-mode">获取消息模式 Ack Mode</a></li>
          </ul>
        </li>
        <li><a href="#rabbitmq整合springboot">RabbitMq整合SpringBoot</a>
          <ul>
            <li><a href="#创建队列-1">创建队列：</a></li>
            <li><a href="#发送消息">发送消息</a></li>
            <li><a href="#处理消息">处理消息</a></li>
          </ul>
        </li>
        <li><a href="#消息队列">消息队列</a>
          <ul>
            <li><a href="#死信队列">死信队列</a></li>
            <li><a href="#工作队列模式">工作队列模式</a></li>
            <li><a href="#发布订阅模式">发布订阅模式</a></li>
            <li><a href="#路由模式">路由模式</a></li>
            <li><a href="#主题模式-trace">主题模式 trace</a></li>
            <li><a href="#第四种交换机类型使用头部信息来实现路由消息到队列中">第四种交换机类型（使用头部信息来实现路由消息到队列中）</a></li>
            <li><a href="#搭建集群">搭建集群</a></li>
          </ul>
        </li>
        <li><a href="#springcloud消息组件">SpringCloud消息组件</a></li>
      </ul>
    </li>
  </ul>
</nav>
  </div>
</details>

 
<script>
  (function () {
    var $toc = $('#TableOfContents');
    if ($toc.length > 0) {
      var $window = $(window);

      function onScroll() {
        var currentScroll = $window.scrollTop();
        var h = $('.anchor');
        var id = "";
        h.each(function (i, e) {
          e = $(e);
          if (e.offset().top - $(window).height()/3 <= currentScroll) {
            id = e.attr('id');
          }
        });
        var active = $toc.find('a.active');      
        if (active.length == 1 && active.eq(0).attr('href') == '#' + id) return true;

        active.each(function (i, e) {
          
            $(e).removeClass('active');
          
        });
        $toc.find('a[href="#' + id + '"]').addClass('active')
        $toc.find('a[href="#' + id + '"]').parentsUntil('#TableOfContents').each(function (i, e) {
          $(e).children('a').parents('ul').show();          
        });
      }

      $window.on('scroll', onScroll);
      $(document).ready(function () {
        
        onScroll();
      });
    }
  })();
</script>
   </div>
        </div>
        

        <div class="min-w-0 min-h-0 max-w-fit">
            


            <div style="width: 100%">
                <div id="认识rabbitmq" class="anchor"></div>
<h2 class="relative group">认识RabbitMQ 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e8%ae%a4%e8%af%86rabbitmq" aria-label="Anchor">#</a></span>        
    
</h2>
<div id="环境ubangtu" class="anchor"></div>
<h3 class="relative group">环境：ubangtu 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e7%8e%af%e5%a2%83ubangtu" aria-label="Anchor">#</a></span>        
    
</h3>
<p>访问协议： amqp</p>
<p>了解安装（反正也记不住）：</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>sudo apt install erlang
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>sudo apt install rabbitmq-server
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>sudo rabbitmqctl status
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>sudo rabbitmq-plugins enable rabbitmq_management
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>sudo rabbitmqctl add_user 用户名 密码
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>sudo rabbitmqctl set_user_tags admin administrator
</span></span></code></pre></div><p>




  
  
    
  
  
    <figure>
      
      <img
        class="my-0 rounded-md"
        srcset="
        /entire-note/mq/img_hufb25942c208a49cebdb4c0d7e13ab56f_245438_330x0_resize_box_3.png 330w,
        /entire-note/mq/img_hufb25942c208a49cebdb4c0d7e13ab56f_245438_660x0_resize_box_3.png 660w,
        /entire-note/mq/img_hufb25942c208a49cebdb4c0d7e13ab56f_245438_1024x0_resize_box_3.png 1024w,
        /entire-note/mq/img_hufb25942c208a49cebdb4c0d7e13ab56f_245438_1320x0_resize_box_3.png 2x"
        src="/entire-note/mq/img_hufb25942c208a49cebdb4c0d7e13ab56f_245438_660x0_resize_box_3.png"
        alt="img.png"
      />
      
      
    </figure>
  

</p>
<p>设计架构图：</p>
<p>




  <figure>
    <img class="my-0 rounded-md" src="https://cdn.jsdelivr.net/gh/Todreamr/img-cloud/img/202311071910832.png" alt="image-20231107191050597" />
    
  </figure>

</p>
<p>**生产者（Publisher）和消费者（Consumer）：**不用多说了吧。
**Channel：**我们的客户端连接都会使用一个Channel，再通过Channel去访问到RabbitMQ服务器，注意通信协议不是http，而是amqp协议。
**Exchange：**类似于交换机一样的存在，会根据我们的请求，转发给相应的消息队列，每个队列都可以绑定到Exchange上，这样Exchange就可以将数据转发给队列了，可以存在很多个，不同的Exchange类型可以用于实现不同消息的模式。
**Queue：**消息队列本体，生产者所有的消息都存放在消息队列中，等待消费者取出。
**Virtual Host：**有点类似于环境隔离，不同环境都可以单独配置一个Virtual Host，每个Virtual Host可以包含很多个Exchange和Queue，每个Virtual Host相互之间不影响。</p>
<p>




  <figure>
    <img class="my-0 rounded-md" src="https://cdn.jsdelivr.net/gh/Todreamr/img-cloud/img/202311071915338.png" alt="image-20231107191531293" />
    
  </figure>

</p>
<p>




  <figure>
    <img class="my-0 rounded-md" src="https://cdn.jsdelivr.net/gh/Todreamr/img-cloud/img/202311071915827.png" alt="image-20231107191556751" />
    
  </figure>

</p>
<div id="交换机" class="anchor"></div>
<h3 class="relative group">交换机 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e4%ba%a4%e6%8d%a2%e6%9c%ba" aria-label="Anchor">#</a></span>        
    
</h3>
<p>交换机有持久化和短暂区分</p>
<ul>
<li>默认交换机：AMQP default，查找方法：根据名称来确定</li>
<li>普通直连交换机：让某个队列直接绑定，查找方法：routingKey指定哪一个队列</li>
</ul>
<div id="创建队列" class="anchor"></div>
<h3 class="relative group">创建队列 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e5%88%9b%e5%bb%ba%e9%98%9f%e5%88%97" aria-label="Anchor">#</a></span>        
    
</h3>
<p>




  <figure>
    <img class="my-0 rounded-md" src="https://cdn.jsdelivr.net/gh/Todreamr/img-cloud/img/202311071925177.png" alt="image-20231107192540029" />
    
  </figure>

</p>
<p>




  <figure>
    <img class="my-0 rounded-md" src="https://cdn.jsdelivr.net/gh/Todreamr/img-cloud/img/202311071928916.png" alt="image-20231107192856835" />
    
  </figure>

</p>
<div id="获取消息模式-ack-mode" class="anchor"></div>
<h3 class="relative group">获取消息模式 Ack Mode 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e8%8e%b7%e5%8f%96%e6%b6%88%e6%81%af%e6%a8%a1%e5%bc%8f-ack-mode" aria-label="Anchor">#</a></span>        
    
</h3>
<p>拒绝消息：Nack mq true</p>
<p>确认应答：Ack mq false</p>
<p>拒绝消息：Reject mq true/false</p>
<p>




  <figure>
    <img class="my-0 rounded-md" src="https://cdn.jsdelivr.net/gh/Todreamr/img-cloud/img/202311071932562.png" alt="image-20231107193209519" />
    
  </figure>

</p>
<div id="rabbitmq整合springboot" class="anchor"></div>
<h2 class="relative group">RabbitMq整合SpringBoot 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#rabbitmq%e6%95%b4%e5%90%88springboot" aria-label="Anchor">#</a></span>        
    
</h2>
<div id="创建队列-1" class="anchor"></div>
<h3 class="relative group">创建队列： 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e5%88%9b%e5%bb%ba%e9%98%9f%e5%88%97-1" aria-label="Anchor">#</a></span>        
    
</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-latex" data-lang="latex"><span style="display:flex;"><span>@Configuration
</span></span><span style="display:flex;"><span>public class RabbitConfiguration {
</span></span><span style="display:flex;"><span>    @Bean(&#34;directExchange&#34;)  //定义交换机Bean，可以很多个
</span></span><span style="display:flex;"><span>    public Exchange exchange(){
</span></span><span style="display:flex;"><span>        return ExchangeBuilder.directExchange(&#34;amq.direct&#34;).build();
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    @Bean(&#34;yydsQueue&#34;)     //定义消息队列
</span></span><span style="display:flex;"><span>    public Queue queue(){
</span></span><span style="display:flex;"><span>        return QueueBuilder
</span></span><span style="display:flex;"><span>                .nonDurable(&#34;my-rainy&#34;)   //非持久化类型
</span></span><span style="display:flex;"><span>                .build();
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>    @Bean(&#34;binding&#34;)
</span></span><span style="display:flex;"><span>    public Binding binding(@Qualifier(&#34;directExchange&#34;) Exchange exchange,
</span></span><span style="display:flex;"><span>                           @Qualifier(&#34;yydsQueue&#34;) Queue queue){
</span></span><span style="display:flex;"><span>        //将我们刚刚定义的交换机和队列进行绑定
</span></span><span style="display:flex;"><span>        return BindingBuilder
</span></span><span style="display:flex;"><span>                .bind(queue)   //绑定队列
</span></span><span style="display:flex;"><span>                .to(exchange)  //到交换机
</span></span><span style="display:flex;"><span>                .with(&#34;rainy&#34;)   //使用自定义的routingKey
</span></span><span style="display:flex;"><span>                .noargs();
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>    //转换为Json实体数据
</span></span><span style="display:flex;"><span>    @Bean(name = &#34;Jackson2JsonMessageConverter&#34;)
</span></span><span style="display:flex;"><span>    public Jackson2JsonMessageConverter jsonMessageConverter(){
</span></span><span style="display:flex;"><span>        return new Jackson2JsonMessageConverter();
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>在上面的配置中，创建了队列并且绑定了routingkey和对应的交换机，同时加入了自定义的json转换器件</p>
<div id="发送消息" class="anchor"></div>
<h3 class="relative group">发送消息 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e5%8f%91%e9%80%81%e6%b6%88%e6%81%af" aria-label="Anchor">#</a></span>        
    
</h3>
<p>——&gt; 借助RabbitTemplate</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-latex" data-lang="latex"><span style="display:flex;"><span>@SpringBootTest
</span></span><span style="display:flex;"><span>@Import(RabbitConfiguration.class)
</span></span><span style="display:flex;"><span>class RabbitmqDemoApplicationTests {
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>	//消息解释器
</span></span><span style="display:flex;"><span>	@Resource
</span></span><span style="display:flex;"><span>	RabbitTemplate template;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>	@Test
</span></span><span style="display:flex;"><span>	void publisher() {
</span></span><span style="display:flex;"><span>		//使用convertAndSend方法一步到位，参数基本和之前是一样的
</span></span><span style="display:flex;"><span>		//最后一个消息本体可以是Object类型，真是大大的方便
</span></span><span style="display:flex;"><span>		template.convertAndSend(&#34;amq.direct&#34;, &#34;rainy&#34;, &#34;Hello World!&#34;);//发送消息
</span></span><span style="display:flex;"><span>		//如何知道发送的消息是否经过处理了？
</span></span><span style="display:flex;"><span>		Object ackMsg = template.convertSendAndReceive(&#34;amq.direct&#34;, &#34;rainy&#34;, &#34;Hello World!&#34;);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>	}
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><div id="处理消息" class="anchor"></div>
<h3 class="relative group">处理消息 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e5%a4%84%e7%90%86%e6%b6%88%e6%81%af" aria-label="Anchor">#</a></span>        
    
</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-latex" data-lang="latex"><span style="display:flex;"><span>/**
</span></span><span style="display:flex;"><span> * TestListener
</span></span><span style="display:flex;"><span> * 监听器，实际上作为消费者
</span></span><span style="display:flex;"><span> * @author 春江花朝秋月夜
</span></span><span style="display:flex;"><span> * @since 2023/11/10 0:12
</span></span><span style="display:flex;"><span> */
</span></span><span style="display:flex;"><span>@Component  //注册为Bean,作为接受消息同时处理返回的监听器
</span></span><span style="display:flex;"><span>public class TestListener {
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    @RabbitListener(queues = &#34;rainy&#34;)   //定义此方法为队列rainy的监听器，一旦监听到新的消息，就会接受并处理
</span></span><span style="display:flex;"><span>    public void test(Message message){
</span></span><span style="display:flex;"><span>        System.out.println(new String(message.getBody()));//打印消息体,消息payload可以自动转换成消息实体
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>    @RabbitListener(queues = &#34;rainy&#34;)   //定义此方法为队列rainy的监听器，一旦监听到新的消息，就会接受并处理，同时还要返回响应信息
</span></span><span style="display:flex;"><span>    public String ackMsg(Message message){
</span></span><span style="display:flex;"><span>        System.out.println(new String(message.getBody()));//打印消息体,消息payload可以自动转换成消息实体
</span></span><span style="display:flex;"><span>        return &#34;响应成功！&#34;;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>    @RabbitListener(queues = &#34;rainy&#34;,messageConverter = &#34;Jackson2JsonMessageConverter&#34;)   //定义此方法为队列rainy的监听器，一旦监听到新的消息，就会接受并处理，同时还要返回响应信息
</span></span><span style="display:flex;"><span>    public String ackDTOMsg(Account message){
</span></span><span style="display:flex;"><span>        System.out.println(message);//打印消息体,使用定义好的json转换器来转换消息中的json数据
</span></span><span style="display:flex;"><span>        return &#34;响应成功！&#34;;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><div id="消息队列" class="anchor"></div>
<h2 class="relative group">消息队列 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e6%b6%88%e6%81%af%e9%98%9f%e5%88%97" aria-label="Anchor">#</a></span>        
    
</h2>
<div id="死信队列" class="anchor"></div>
<h3 class="relative group">死信队列 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e6%ad%bb%e4%bf%a1%e9%98%9f%e5%88%97" aria-label="Anchor">#</a></span>        
    
</h3>
<p>




  
  
    
  
  
    <figure>
      
      <img
        class="my-0 rounded-md"
        srcset="
        /entire-note/mq/img_1_hue378a94925db4d360115e8b1fb24854e_261339_330x0_resize_box_3.png 330w,
        /entire-note/mq/img_1_hue378a94925db4d360115e8b1fb24854e_261339_660x0_resize_box_3.png 660w,
        /entire-note/mq/img_1_hue378a94925db4d360115e8b1fb24854e_261339_1024x0_resize_box_3.png 1024w,
        /entire-note/mq/img_1_hue378a94925db4d360115e8b1fb24854e_261339_1320x0_resize_box_3.png 2x"
        src="/entire-note/mq/img_1_hue378a94925db4d360115e8b1fb24854e_261339_660x0_resize_box_3.png"
        alt="img_1.png"
      />
      
      
    </figure>
  

</p>
<p>判定死信：</p>
<ul>
<li>消息被拒绝</li>
<li>消息TTL过期</li>
<li>队列达到最大长度，相当于被拒绝reject</li>
</ul>
<p>死信队列创建和监听和正常队列差不多</p>
<p>RabbitMQ支持将超过一定时间没被消费的消息自动删除，这需要消息队列设定TTL值，如果消息的存活时间超过了Time To Live值，就会被自动删除，自动删除后的消息如果有死信队列，那么就会进入到死信队列中。</p>
<p>如果到达队列长度限制，那么每次插入都会把位于队首的消息丢进死信队列，来腾出空间给新来的消息。</p>
<div id="工作队列模式" class="anchor"></div>
<h3 class="relative group">工作队列模式 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e5%b7%a5%e4%bd%9c%e9%98%9f%e5%88%97%e6%a8%a1%e5%bc%8f" aria-label="Anchor">#</a></span>        
    
</h3>
<p>




  
  
    
  
  
    <figure>
      
      <img
        class="my-0 rounded-md"
        srcset="
        /entire-note/mq/img_2_hu6ac491315e63274e04f8b90c8f7d0117_103543_330x0_resize_box_3.png 330w,
        /entire-note/mq/img_2_hu6ac491315e63274e04f8b90c8f7d0117_103543_660x0_resize_box_3.png 660w,
        /entire-note/mq/img_2_hu6ac491315e63274e04f8b90c8f7d0117_103543_1024x0_resize_box_3.png 1024w,
        /entire-note/mq/img_2_hu6ac491315e63274e04f8b90c8f7d0117_103543_1320x0_resize_box_3.png 2x"
        src="/entire-note/mq/img_2_hu6ac491315e63274e04f8b90c8f7d0117_103543_660x0_resize_box_3.png"
        alt="img_2.png"
      />
      
      
    </figure>
  

</p>
<p><strong>轮询分发消息</strong>：默认交替分发消息，但每个消费者都有一个预先获取数量，最开始一次性获取数量不一定是1</p>
<p>配置消费者预获取数量：</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-latex" data-lang="latex"><span style="display:flex;"><span>@Resource
</span></span><span style="display:flex;"><span>private CachingConnectionFactory connectionFactory;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>@Bean(name = &#34;listenerContainer&#34;)
</span></span><span style="display:flex;"><span>public SimpleRabbitListenerContainerFactory listenerContainer(){
</span></span><span style="display:flex;"><span>    SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
</span></span><span style="display:flex;"><span>    factory.setConnectionFactory(connectionFactory);
</span></span><span style="display:flex;"><span>    factory.setPrefetchCount(1);   //将PrefetchCount设定为1表示一次只能取一个
</span></span><span style="display:flex;"><span>    return factory;
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>配置监听器：</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-latex" data-lang="latex"><span style="display:flex;"><span> //指定的监听器工厂和消费者数量
</span></span><span style="display:flex;"><span>    @RabbitListener(queues = &#34;rainy&#34;,containerFactory = &#34;listenerContainer&#34;,concurrency = &#34;10&#34;)
</span></span><span style="display:flex;"><span>    public void listenMsg(Message message){
</span></span><span style="display:flex;"><span>        System.out.println(message);
</span></span><span style="display:flex;"><span>    }
</span></span></code></pre></div><div id="发布订阅模式" class="anchor"></div>
<h3 class="relative group">发布订阅模式 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e5%8f%91%e5%b8%83%e8%ae%a2%e9%98%85%e6%a8%a1%e5%bc%8f" aria-label="Anchor">#</a></span>        
    
</h3>
<p>




  
  
    
  
  
    <figure>
      
      <img
        class="my-0 rounded-md"
        srcset="
        /entire-note/mq/img_3_hubbcde0b8e4f5873f8673cb1e17b2eaa8_216431_330x0_resize_box_3.png 330w,
        /entire-note/mq/img_3_hubbcde0b8e4f5873f8673cb1e17b2eaa8_216431_660x0_resize_box_3.png 660w,
        /entire-note/mq/img_3_hubbcde0b8e4f5873f8673cb1e17b2eaa8_216431_1024x0_resize_box_3.png 1024w,
        /entire-note/mq/img_3_hubbcde0b8e4f5873f8673cb1e17b2eaa8_216431_1320x0_resize_box_3.png 2x"
        src="/entire-note/mq/img_3_hubbcde0b8e4f5873f8673cb1e17b2eaa8_216431_660x0_resize_box_3.png"
        alt="img_3.png"
      />
      
      
    </figure>
  

</p>
<p>注意这时候交换机已经发生变化了，直连交换机不可行，需要使用channel-exchange一对多也就是amq.finout，扇出类型</p>
<div id="路由模式" class="anchor"></div>
<h3 class="relative group">路由模式 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e8%b7%af%e7%94%b1%e6%a8%a1%e5%bc%8f" aria-label="Anchor">#</a></span>        
    
</h3>
<p>通过路由来确定绑定到哪些队列里面去</p>
<p>




  
  
    
  
  
    <figure>
      
      <img
        class="my-0 rounded-md"
        srcset="
        /entire-note/mq/img_4_hu3b4865e1a49898a5c210a6bc79a4c5df_131365_330x0_resize_box_3.png 330w,
        /entire-note/mq/img_4_hu3b4865e1a49898a5c210a6bc79a4c5df_131365_660x0_resize_box_3.png 660w,
        /entire-note/mq/img_4_hu3b4865e1a49898a5c210a6bc79a4c5df_131365_1024x0_resize_box_3.png 1024w,
        /entire-note/mq/img_4_hu3b4865e1a49898a5c210a6bc79a4c5df_131365_1320x0_resize_box_3.png 2x"
        src="/entire-note/mq/img_4_hu3b4865e1a49898a5c210a6bc79a4c5df_131365_660x0_resize_box_3.png"
        alt="img_4.png"
      />
      
      
    </figure>
  

</p>
<p>通过指定不同的routingkey来实现</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-java" data-lang="java"><span style="display:flex;"><span><span style="color:#a6e22e">@Configuration</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">public</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">RabbitConfiguration</span> <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">@Bean</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;fanoutExchange&#34;</span><span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">public</span> Exchange <span style="color:#a6e22e">exchange</span><span style="color:#f92672">(){</span>
</span></span><span style="display:flex;"><span>      	<span style="color:#75715e">//注意这里是fanoutExchange
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>        <span style="color:#66d9ef">return</span> ExchangeBuilder<span style="color:#f92672">.</span><span style="color:#a6e22e">fanoutExchange</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;amq.fanout&#34;</span><span style="color:#f92672">).</span><span style="color:#a6e22e">build</span><span style="color:#f92672">();</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">@Bean</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;yydsQueue1&#34;</span><span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">public</span> Queue <span style="color:#a6e22e">queue</span><span style="color:#f92672">(){</span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> QueueBuilder<span style="color:#f92672">.</span><span style="color:#a6e22e">nonDurable</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;yyds1&#34;</span><span style="color:#f92672">).</span><span style="color:#a6e22e">build</span><span style="color:#f92672">();</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">@Bean</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;binding&#34;</span><span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">public</span> Binding <span style="color:#a6e22e">binding</span><span style="color:#f92672">(</span><span style="color:#a6e22e">@Qualifier</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;fanoutExchange&#34;</span><span style="color:#f92672">)</span> Exchange exchange<span style="color:#f92672">,</span>
</span></span><span style="display:flex;"><span>                           <span style="color:#a6e22e">@Qualifier</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;yydsQueue1&#34;</span><span style="color:#f92672">)</span> Queue queue<span style="color:#f92672">){</span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> BindingBuilder
</span></span><span style="display:flex;"><span>                <span style="color:#f92672">.</span><span style="color:#a6e22e">bind</span><span style="color:#f92672">(</span>queue<span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>                <span style="color:#f92672">.</span><span style="color:#a6e22e">to</span><span style="color:#f92672">(</span>exchange<span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>                <span style="color:#f92672">.</span><span style="color:#a6e22e">with</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;yyds1&#34;</span><span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>                <span style="color:#f92672">.</span><span style="color:#a6e22e">noargs</span><span style="color:#f92672">();</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">@Bean</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;yydsQueue2&#34;</span><span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">public</span> Queue <span style="color:#a6e22e">queue2</span><span style="color:#f92672">(){</span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> QueueBuilder<span style="color:#f92672">.</span><span style="color:#a6e22e">nonDurable</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;yyds2&#34;</span><span style="color:#f92672">).</span><span style="color:#a6e22e">build</span><span style="color:#f92672">();</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">@Bean</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;binding2&#34;</span><span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">public</span> Binding <span style="color:#a6e22e">binding2</span><span style="color:#f92672">(</span><span style="color:#a6e22e">@Qualifier</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;fanoutExchange&#34;</span><span style="color:#f92672">)</span> Exchange exchange<span style="color:#f92672">,</span>
</span></span><span style="display:flex;"><span>                           <span style="color:#a6e22e">@Qualifier</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;yydsQueue2&#34;</span><span style="color:#f92672">)</span> Queue queue<span style="color:#f92672">){</span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> BindingBuilder
</span></span><span style="display:flex;"><span>                <span style="color:#f92672">.</span><span style="color:#a6e22e">bind</span><span style="color:#f92672">(</span>queue<span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>                <span style="color:#f92672">.</span><span style="color:#a6e22e">to</span><span style="color:#f92672">(</span>exchange<span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>                <span style="color:#f92672">.</span><span style="color:#a6e22e">with</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;yyds2&#34;</span><span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>                <span style="color:#f92672">.</span><span style="color:#a6e22e">noargs</span><span style="color:#f92672">();</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">}</span>
</span></span></code></pre></div><div id="主题模式-trace" class="anchor"></div>
<h3 class="relative group">主题模式 trace 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e4%b8%bb%e9%a2%98%e6%a8%a1%e5%bc%8f-trace" aria-label="Anchor">#</a></span>        
    
</h3>
<p>通过routingKey的模糊匹配来实现，帮助进行日志追踪</p>
<p>




  
  
    
  
  
    <figure>
      
      <img
        class="my-0 rounded-md"
        srcset="
        /entire-note/mq/img_5_hu011406790ccdf43817dbb8fabb0977ac_99514_330x0_resize_box_3.png 330w,
        /entire-note/mq/img_5_hu011406790ccdf43817dbb8fabb0977ac_99514_660x0_resize_box_3.png 660w,
        /entire-note/mq/img_5_hu011406790ccdf43817dbb8fabb0977ac_99514_1024x0_resize_box_3.png 1024w,
        /entire-note/mq/img_5_hu011406790ccdf43817dbb8fabb0977ac_99514_1320x0_resize_box_3.png 2x"
        src="/entire-note/mq/img_5_hu011406790ccdf43817dbb8fabb0977ac_99514_660x0_resize_box_3.png"
        alt="img_5.png"
      />
      
      
    </figure>
  

</p>
<p>




  
  
    
  
  
    <figure>
      
      <img
        class="my-0 rounded-md"
        srcset="
        /entire-note/mq/img_6_hu33830332fb75ef7b104f76c405b52578_98187_330x0_resize_box_3.png 330w,
        /entire-note/mq/img_6_hu33830332fb75ef7b104f76c405b52578_98187_660x0_resize_box_3.png 660w,
        /entire-note/mq/img_6_hu33830332fb75ef7b104f76c405b52578_98187_1024x0_resize_box_3.png 1024w,
        /entire-note/mq/img_6_hu33830332fb75ef7b104f76c405b52578_98187_1320x0_resize_box_3.png 2x"
        src="/entire-note/mq/img_6_hu33830332fb75ef7b104f76c405b52578_98187_660x0_resize_box_3.png"
        alt="img_6.png"
      />
      
      
    </figure>
  

</p>
<div id="第四种交换机类型使用头部信息来实现路由消息到队列中" class="anchor"></div>
<h3 class="relative group">第四种交换机类型（使用头部信息来实现路由消息到队列中） 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e7%ac%ac%e5%9b%9b%e7%a7%8d%e4%ba%a4%e6%8d%a2%e6%9c%ba%e7%b1%bb%e5%9e%8b%e4%bd%bf%e7%94%a8%e5%a4%b4%e9%83%a8%e4%bf%a1%e6%81%af%e6%9d%a5%e5%ae%9e%e7%8e%b0%e8%b7%af%e7%94%b1%e6%b6%88%e6%81%af%e5%88%b0%e9%98%9f%e5%88%97%e4%b8%ad" aria-label="Anchor">#</a></span>        
    
</h3>
<p>已经介绍了三种交换机类型，现在来介绍一下第四种交换机类型header，它是根据头部信息来决定的，
在我们发送的消息中是可以携带一些头部信息的（类似于HTTP），我们可以根据这些头部信息来决定路由到哪一个消息队列中。</p>
<div id="搭建集群" class="anchor"></div>
<h3 class="relative group">搭建集群 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#%e6%90%ad%e5%bb%ba%e9%9b%86%e7%be%a4" aria-label="Anchor">#</a></span>        
    
</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>sudo rabbitmqctl stop_app
</span></span><span style="display:flex;"><span>sudo rabbitmqctl join_cluster rabbit@ubuntu-server
</span></span><span style="display:flex;"><span>sudo rabbitmqctl start_app
</span></span></code></pre></div><div id="springcloud消息组件" class="anchor"></div>
<h2 class="relative group">SpringCloud消息组件 
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
            style="text-decoration-line: none !important;" href="#springcloud%e6%b6%88%e6%81%af%e7%bb%84%e4%bb%b6" aria-label="Anchor">#</a></span>        
    
</h2>
<p>KafKa?RabbitMq?</p>
<p>




  
  
    
  
  
    <figure>
      
      <img
        class="my-0 rounded-md"
        srcset="
        /entire-note/mq/img_7_hu6d0f764306f33c00c9fc7aa724bebc21_207376_330x0_resize_box_3.png 330w,
        /entire-note/mq/img_7_hu6d0f764306f33c00c9fc7aa724bebc21_207376_660x0_resize_box_3.png 660w,
        /entire-note/mq/img_7_hu6d0f764306f33c00c9fc7aa724bebc21_207376_1024x0_resize_box_3.png 1024w,
        /entire-note/mq/img_7_hu6d0f764306f33c00c9fc7aa724bebc21_207376_1320x0_resize_box_3.png 2x"
        src="/entire-note/mq/img_7_hu6d0f764306f33c00c9fc7aa724bebc21_207376_660x0_resize_box_3.png"
        alt="img_7.png"
      />
      
      
    </figure>
  

</p>
<p>尝试搭建微服务项目</p>
<p>




  
  
    
  
  
    <figure>
      
      <img
        class="my-0 rounded-md"
        srcset="
        /entire-note/mq/img_8_hu1dec36206cc2e189d40f131377aa448f_478867_330x0_resize_box_3.png 330w,
        /entire-note/mq/img_8_hu1dec36206cc2e189d40f131377aa448f_478867_660x0_resize_box_3.png 660w,
        /entire-note/mq/img_8_hu1dec36206cc2e189d40f131377aa448f_478867_1024x0_resize_box_3.png 1024w,
        /entire-note/mq/img_8_hu1dec36206cc2e189d40f131377aa448f_478867_1320x0_resize_box_3.png 2x"
        src="/entire-note/mq/img_8_hu1dec36206cc2e189d40f131377aa448f_478867_660x0_resize_box_3.png"
        alt="img_8.png"
      />
      
      
    </figure>
  

</p>

            </div>

            

            
  
  <section class="flex flex-row flex-wrap justify-center pt-4 text-xl">
    
      
    
      
      <a
      target="_blank"
      class="m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800"
      href="https://twitter.com/intent/tweet/?url=/entire-note/mq/&amp;text=RabbitMq"
      title="Tweet on Twitter"
      aria-label="Tweet on Twitter"
      >
      

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"/></svg>
  </span>


    </a>
      
    
      
      <a
      target="_blank"
      class="m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800"
      href="https://t.me/share/url?url=/entire-note/mq/&amp;resubmit=true&amp;title=RabbitMq"
      title=""
      aria-label=""
      >
      

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M248,8C111.033,8,0,119.033,0,256S111.033,504,248,504,496,392.967,496,256,384.967,8,248,8ZM362.952,176.66c-3.732,39.215-19.881,134.378-28.1,178.3-3.476,18.584-10.322,24.816-16.948,25.425-14.4,1.326-25.338-9.517-39.287-18.661-21.827-14.308-34.158-23.215-55.346-37.177-24.485-16.135-8.612-25,5.342-39.5,3.652-3.793,67.107-61.51,68.335-66.746.153-.655.3-3.1-1.154-4.384s-3.59-.849-5.135-.5q-3.283.746-104.608,69.142-14.845,10.194-26.894,9.934c-8.855-.191-25.888-5.006-38.551-9.123-15.531-5.048-27.875-7.717-26.8-16.291q.84-6.7,18.45-13.7,108.446-47.248,144.628-62.3c68.872-28.647,83.183-33.623,92.511-33.789,2.052-.034,6.639.474,9.61,2.885a10.452,10.452,0,0,1,3.53,6.716A43.765,43.765,0,0,1,362.952,176.66Z"/></svg>

  </span>


    </a>
      
    
      
      <a
      target="_blank"
      class="m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800"
      href="mailto:?body=/entire-note/mq/&amp;subject=RabbitMq"
      title="Send via email"
      aria-label="Send via email"
      >
      

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M207.8 20.73c-93.45 18.32-168.7 93.66-187 187.1c-27.64 140.9 68.65 266.2 199.1 285.1c19.01 2.888 36.17-12.26 36.17-31.49l.0001-.6631c0-15.74-11.44-28.88-26.84-31.24c-84.35-12.98-149.2-86.13-149.2-174.2c0-102.9 88.61-185.5 193.4-175.4c91.54 8.869 158.6 91.25 158.6 183.2l0 16.16c0 22.09-17.94 40.05-40 40.05s-40.01-17.96-40.01-40.05v-120.1c0-8.847-7.161-16.02-16.01-16.02l-31.98 .0036c-7.299 0-13.2 4.992-15.12 11.68c-24.85-12.15-54.24-16.38-86.06-5.106c-38.75 13.73-68.12 48.91-73.72 89.64c-9.483 69.01 43.81 128 110.9 128c26.44 0 50.43-9.544 69.59-24.88c24 31.3 65.23 48.69 109.4 37.49C465.2 369.3 496 324.1 495.1 277.2V256.3C495.1 107.1 361.2-9.332 207.8 20.73zM239.1 304.3c-26.47 0-48-21.56-48-48.05s21.53-48.05 48-48.05s48 21.56 48 48.05S266.5 304.3 239.1 304.3z"/></svg>

  </span>


    </a>
      
    
  </section>


            


<h2 class="mt-8 text-2xl font-extrabold mb-10">Related</h2>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
  
  

  <a href="/entire-note/vue/" class="min-w-full">
    
    <div class="min-h-full border border-neutral-200 dark:border-neutral-700 border-2 rounded overflow-hidden shadow-2xl relative backdrop-blur">
        
        <div class="w-full thumbnail_card_related nozoom" style="background-image:url(/entire-note/vue/featured_hud4e391f196043a7dcc8dd215f8298dc5_96858_600x0_resize_box_3.png);"></div>
        
      

      <div class="px-6 py-4">

        
        <div class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
          href="/entire-note/vue/">Vue3 响应式Api开发笔记</div>
        

        <div class="text-sm text-neutral-500 dark:text-neutral-400">
          

































<div class="flex flex-row flex-wrap items-center">
  
  
  <span title="Reading time">2 mins</span><span class="px-2 text-primary-500">&middot;</span><span>
    
    <span id="views_entire-note\vue\index.md" title="views">0</span> 
    
    <span class="inline-block align-text-bottom">

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">
<path fill="currentColor" d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM432 256c0 79.5-64.5 144-144 144s-144-64.5-144-144s64.5-144 144-144s144 64.5 144 144zM288 192c0 35.3-28.7 64-64 64c-11.5 0-22.3-3-31.6-8.4c-.2 2.8-.4 5.5-.4 8.4c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-2.8 0-5.6 .1-8.4 .4c5.3 9.3 8.4 20.1 8.4 31.6z"/></svg>
  </span>

</span>
</span><span class="px-2 text-primary-500">&middot;</span><span>
    
    <span id="likes_entire-note\vue\index.md" title="likes">0</span> 
    
    <span class="inline-block align-text-bottom">

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path fill="currentColor" d="M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"/></svg>
  </span>

</span>
</span>
  

  
  
</div>


<div class="flex flex-row flex-wrap items-center">
  
  
  
  
  
  
  
  
  
  
  
</div>




<div class="flex flex-row flex-wrap items-center">
  
  
  
  
  
  
  
  
  
  
  
  
  <span style="margin-top:0.5rem" class="mr-2" onclick="window.open(&#34;/tags/vue/&#34;,'_self');">
    <span class="flex">
  <span
    class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400"
  >
    vue
  </span>
</span>

  </span>
  
  
  
  
</div>



        </div>

        
      </div>
      <div class="px-6 pt-4 pb-2">

      </div>
    </div>
  </a>
  
  

  <a href="/entire-note/%E5%9B%BE%E5%BA%8A/" class="min-w-full">
    
    <div class="min-h-full border border-neutral-200 dark:border-neutral-700 border-2 rounded overflow-hidden shadow-2xl relative backdrop-blur">
        
        <div class="w-full thumbnail_card_related nozoom" style="background-image:url(/entire-note/%E5%9B%BE%E5%BA%8A/featured_hu4038ae6a3874421a74084ffa05a18d88_795825_600x0_resize_box_3.png);"></div>
        
      

      <div class="px-6 py-4">

        
        <div class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
          href="/entire-note/%E5%9B%BE%E5%BA%8A/">搭建图床</div>
        

        <div class="text-sm text-neutral-500 dark:text-neutral-400">
          

































<div class="flex flex-row flex-wrap items-center">
  
  
  <span title="Reading time">1 min</span><span class="px-2 text-primary-500">&middot;</span><span>
    
    <span id="views_entire-note\图床\index.md" title="views">0</span> 
    
    <span class="inline-block align-text-bottom">

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">
<path fill="currentColor" d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM432 256c0 79.5-64.5 144-144 144s-144-64.5-144-144s64.5-144 144-144s144 64.5 144 144zM288 192c0 35.3-28.7 64-64 64c-11.5 0-22.3-3-31.6-8.4c-.2 2.8-.4 5.5-.4 8.4c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-2.8 0-5.6 .1-8.4 .4c5.3 9.3 8.4 20.1 8.4 31.6z"/></svg>
  </span>

</span>
</span><span class="px-2 text-primary-500">&middot;</span><span>
    
    <span id="likes_entire-note\图床\index.md" title="likes">0</span> 
    
    <span class="inline-block align-text-bottom">

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path fill="currentColor" d="M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"/></svg>
  </span>

</span>
</span>
  

  
  
</div>


<div class="flex flex-row flex-wrap items-center">
  
  
  
  
  
  
  
  
  
  
  
</div>




<div class="flex flex-row flex-wrap items-center">
  
  
  
  
  
  
  
  
  
  
  
  
  <span style="margin-top:0.5rem" class="mr-2" onclick="window.open(&#34;/tags/%E7%AC%94%E8%AE%B0/&#34;,'_self');">
    <span class="flex">
  <span
    class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400"
  >
    笔记
  </span>
</span>

  </span>
  
  
  
  
</div>



        </div>

        
      </div>
      <div class="px-6 pt-4 pb-2">

      </div>
    </div>
  </a>
  
  

  <a href="/entire-note/c&#43;&#43;/" class="min-w-full">
    
    <div class="min-h-full border border-neutral-200 dark:border-neutral-700 border-2 rounded overflow-hidden shadow-2xl relative backdrop-blur">
        
        <div class="w-full thumbnail_card_related nozoom" style="background-image:url(/img/default_bg_hu2c8ae63088ae0a9e08ad1099ffefae54_137932_600x0_resize_q75_box.jpg);"></div>
        
      

      <div class="px-6 py-4">

        
        <div class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
          href="/entire-note/c&#43;&#43;/">C++</div>
        

        <div class="text-sm text-neutral-500 dark:text-neutral-400">
          

































<div class="flex flex-row flex-wrap items-center">
  
  
  <span title="Reading time">6 mins</span><span class="px-2 text-primary-500">&middot;</span><span>
    
    <span id="views_entire-note\C&#43;&#43;\index.md" title="views">0</span> 
    
    <span class="inline-block align-text-bottom">

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">
<path fill="currentColor" d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM432 256c0 79.5-64.5 144-144 144s-144-64.5-144-144s64.5-144 144-144s144 64.5 144 144zM288 192c0 35.3-28.7 64-64 64c-11.5 0-22.3-3-31.6-8.4c-.2 2.8-.4 5.5-.4 8.4c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-2.8 0-5.6 .1-8.4 .4c5.3 9.3 8.4 20.1 8.4 31.6z"/></svg>
  </span>

</span>
</span><span class="px-2 text-primary-500">&middot;</span><span>
    
    <span id="likes_entire-note\C&#43;&#43;\index.md" title="likes">0</span> 
    
    <span class="inline-block align-text-bottom">

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path fill="currentColor" d="M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"/></svg>
  </span>

</span>
</span>
  

  
  
</div>


<div class="flex flex-row flex-wrap items-center">
  
  
  
  
  
  
  
  
  
  
  
</div>




<div class="flex flex-row flex-wrap items-center">
  
  
  
  
  
  
  
  
  
  
  
  
  <span style="margin-top:0.5rem" class="mr-2" onclick="window.open(&#34;/tags/%E8%AF%AD%E8%A8%80/&#34;,'_self');">
    <span class="flex">
  <span
    class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400"
  >
    语言
  </span>
</span>

  </span>
  
  
  
  
</div>



        </div>

        
      </div>
      <div class="px-6 pt-4 pb-2">

      </div>
    </div>
  </a>
  
</section>


        </div>

        <script>
            var oid = "views_entire-note\\mq\\index.md"
            var oid_likes = "likes_entire-note\\mq\\index.md"
        </script>
        
        
        <script type="text/javascript" src="/js/page.min.0e49973b4ad0a382c7c6012d8bff8226316642daabc4f8a20477bd08674f3da6e2fa993bc20ad4f51e7c5bb68e6f913a207a7c4fe37ea0e7b806894afce0a64e.js" integrity="sha512-DkmXO0rQo4LHxgEti/&#43;CJjFmQtqrxPiiBHe9CGdPPabi&#43;pk7wgrU9R58W7aOb5E6IHp8T&#43;N&#43;oOe4BolK/OCmTg=="></script>

    </section>
    <footer class="pt-8 max-w-prose print:hidden">

        
  
    
    
    
    <div class="pt-8">
      <hr class="border-dotted border-neutral-300 dark:border-neutral-600" />
      <div class="flex justify-between pt-3">
        <span>
          
            <a class="flex group mr-3" href="/entire-note/vue/">
              <span
                class="mr-3 text-neutral-700 group-hover:text-primary-600 ltr:inline rtl:hidden dark:text-neutral dark:group-hover:text-primary-400"
                >&larr;</span
              >
              <span
                class="ml-3 text-neutral-700 group-hover:text-primary-600 ltr:hidden rtl:inline dark:text-neutral dark:group-hover:text-primary-400"
                >&rarr;</span
              >
              <span class="flex flex-col">
                <span
                  class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"
                  >Vue3 响应式Api开发笔记</span
                >
                <span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
                  
                </span>
              </span>
            </a>
          
        </span>
        <span>
          
            <a class="flex text-right group ml-3" href="/entire-note/%E6%8E%A8%E9%80%81%E7%AC%94%E8%AE%B0/">
              <span class="flex flex-col">
                <span
                  class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"
                  >写点脚本</span
                >
                <span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
                  
                </span>
              </span>
              <span
                class="ml-3 text-neutral-700 group-hover:text-primary-600 ltr:inline rtl:hidden dark:text-neutral dark:group-hover:text-primary-400"
                >&rarr;</span
              >
              <span
                class="mr-3 text-neutral-700 group-hover:text-primary-600 ltr:hidden rtl:inline dark:text-neutral dark:group-hover:text-primary-400"
                >&larr;</span
              >
            </a>
          
        </span>
      </div>
    </div>
  


        
        
        <div class="pt-3">
            <hr class="border-dotted border-neutral-300 dark:border-neutral-600" />
            <div class="pt-3">
                <script src="https://giscus.app/client.js"
        data-repo="ToDreamr/todreamr.github.io"
        data-repo-id="R_kgDOKdiu4A"
        data-category="Announcements"
        data-category-id="DIC_kwDOKdiu4M4Capsk"
        data-mapping="pathname"
        data-strict="0"
        data-reactions-enabled="1"
        data-emit-metadata="0"
        data-input-position="bottom"
        data-theme="preferred_color_scheme"
        data-lang="zh-CN"
        crossorigin="anonymous"
        async>
</script>

            </div>
        </div>
        
        
    </footer>
</article>

      <div id="top-scroller" class="pointer-events-none absolute top-[110vh] bottom-0 w-12 ltr:right-0 rtl:left-0">
  <a href="#the-top"
    class="pointer-events-auto sticky top-[calc(100vh-5.5rem)] flex h-12 w-12 mb-16 items-center justify-center rounded-full bg-neutral/50 text-xl text-neutral-700 backdrop-blur hover:text-primary-600 dark:bg-neutral-800/50 dark:text-neutral dark:hover:text-primary-400"
    aria-label="Scroll to top" title="Scroll to top">
    &uarr;
  </a>
</div>
    </main><footer id="site-footer" class="py-10 print:hidden">
  
  
    
    <nav class="flex flex-row pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400">
      <ul class="flex flex-col list-none sm:flex-row">
        
        <li class="flex mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
          <a class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2" href="/tags/"
            title="Tags">Tags</a>
        </li>
        
        <li class="flex mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
          <a class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2" href="/authors/"
            title="Authors">Authors</a>
        </li>
        
      </ul>
    </nav>
    
  
  <div class="flex items-center justify-between">

    
    
    <p class="text-sm text-neutral-500 dark:text-neutral-400">
      &copy;
      2024
      春江花朝秋月夜
    </p>
    

    
    
    <p class="text-xs text-neutral-500 dark:text-neutral-400">
      
      
      Powered by <a class="hover:underline hover:decoration-primary-400 hover:text-primary-500"
        href="https://gohugo.io/" target="_blank" rel="noopener noreferrer">Hugo</a> &amp; <a class="hover:underline hover:decoration-primary-400 hover:text-primary-500"
        href="https://blowfish.page/" target="_blank" rel="noopener noreferrer">Blowfish</a>
    </p>
    

  </div>
  <script>
    
    mediumZoom(document.querySelectorAll("img:not(.nozoom)"), {
      margin: 24,
      background: 'rgba(0,0,0,0.5)',
      scrollOffset: 0,
    })
    
  </script>
  
  
  <script type="text/javascript" src="/js/process.min.35c1113bcc16c5a59bf031082f9e63822aa95280423881a7847a7ff33a16e6299ce6a840d9ef4e10d947e030a18f3f20359afb2ec0f35967484b9a9360ac3145.js" integrity="sha512-NcERO8wWxaWb8DEIL55jgiqpUoBCOIGnhHp/8zoW5imc5qhA2e9OENlH4DChjz8gNZr7LsDzWWdIS5qTYKwxRQ=="></script>
  
  
</footer><div
  id="search-wrapper"
  class="invisible fixed inset-0 flex h-screen w-screen cursor-default flex-col bg-neutral-500/50 p-4 backdrop-blur-sm dark:bg-neutral-900/50 sm:p-6 md:p-[10vh] lg:p-[12vh]"
  data-url="/"
  style="z-index:500"
>
  <div
    id="search-modal"
    class="flex flex-col w-full max-w-3xl min-h-0 mx-auto border rounded-md shadow-lg top-20 border-neutral-200 bg-neutral dark:border-neutral-700 dark:bg-neutral-800"
  >
    <header class="relative z-10 flex items-center justify-between flex-none px-2">
      <form class="flex items-center flex-auto min-w-0">
        <div class="flex items-center justify-center w-8 h-8 text-neutral-400">
          

  <span class="relative block icon">
    <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="search" class="svg-inline--fa fa-search fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"/></svg>

  </span>


        </div>
        <input
          type="search"
          id="search-query"
          class="flex flex-auto h-12 mx-1 bg-transparent appearance-none focus:outline-dotted focus:outline-2 focus:outline-transparent"
          placeholder="Search"
          tabindex="0"
        />
      </form>
      <button
        id="close-search-button"
        class="flex items-center justify-center w-8 h-8 text-neutral-700 hover:text-primary-600 dark:text-neutral dark:hover:text-primary-400"
        title="Close (Esc)"
      >
        

  <span class="relative block icon">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>

  </span>


      </button>
    </header>
    <section class="flex-auto px-2 overflow-auto">
      <ul id="search-results">
        
      </ul>
    </section>
  </div>
</div>

  </div>
</body>

</html>
